/**
 * UUIDUtils.java
 * Created at 2017-6-13
 * Created by xieshuang
 * Copyright (C) 2017 BROADTEXT SOFTWARE, All rights reserved.
 */
package com.broadtext.common.utils;

import java.util.UUID;

/**
 * <p>ClassName: UUIDUtils</p>
 * <p>Description: 获取uuid主键</p>
 * <p>Author: xieshuang</p>
 * <p>Date: 2017-6-13</p>
 */
public class UUIDUtils {
	/**
	 * 获得一个UUID
	 * 
	 * @return String UUID
	 */
	public static String getUUID()
	{
		return UUID.randomUUID().toString().replaceAll("-", "");
	}

	/**
	 * 获得指定数目的UUID
	 * 
	 * @param number
	 *            int 需要获得的UUID数量
	 * @return String[] UUID数组
	 */
	public static String[] getUUID(int number)
	{
		if (number < 1)
		{
			return null;
		}
		String[] ss = new String[number];
		for (int i = 0; i < number; i++)
		{
			ss[i] = getUUID();
		}
		return ss;
	}
}
